-- GENERATED SPELL FOR [Crypt Guard] --


function spell0_16573(pUnit, Event) --@Acid Spit,n/a--
pUnit:FullCastSpellOnTarget(28969,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16573', 10000, 1)
end

function spell1_16573(pUnit, Event) --@Acid Spit,n/a--
pUnit:FullCastSpellOnTarget(56098,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16573', 10000, 1)
end

function spell2_16573(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16573', 588, 1)
end

function spell3_16573(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(8269,pUnit)
pUnit:RegisterEvent('Sorts_16573', 546, 1)
end

function Sorts_16573(pUnit, Event)
local choix_sorts_16573 = math.random(0, 3)
if choix_sorts_16573 == 0 then
pUnit:RegisterEvent('spell0_16573', 1, 1)
end
if choix_sorts_16573 == 1 then
pUnit:RegisterEvent('spell1_16573', 1, 1)
end
if choix_sorts_16573 == 2 then
pUnit:RegisterEvent('spell2_16573', 1, 1)
end
if choix_sorts_16573 == 3 then
pUnit:RegisterEvent('spell3_16573', 1, 1)
end
end

function mob16573_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16573', math.random(1500, 3000), 1)
end

function mob16573_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16573_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16573_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16573, 1, 'mob16573_Action')
RegisterUnitEvent(16573, 2, 'mob16573_Leave')
RegisterUnitEvent(16573, 3, 'mob16573_Kill')
RegisterUnitEvent(16573, 4, 'mob16573_Die')
